package com.liezh.bridge.could;

import java.util.HashMap;
import java.util.Map;

/**
 * @author liezh
 * @date 2021-9-2
 */
public class S3FileUploadExcutor implements CloudFileUploadExcutor {
    @Override
    public Object uploadFile(String path, Object file) {
        System.out.println("亚马逊S3");
        System.out.println("上传地址： " + path);
        System.out.println("文件： "+ file.hashCode());
        // TODO 上传到亚马逊S3, 返回结果
        Map<String, String> result = new HashMap<>(2);
        result.put("key", String.valueOf(file.hashCode()));
        result.put("file", String.valueOf("https://s3.amazon.com/file/" + file.hashCode()));
        return result;
    }

    @Override
    public boolean checkFile(Object file) {
        System.out.println("文件： "+ file.hashCode());
        System.out.println("校验通过");
        return true;
    }
}
